package com.cell.api.application.netty.coder;

import com.cell.api.application.netty.utils.CoderUtils;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageDecoder;

import java.util.List;

/**
 * <p>
 * 解码
 * </p>
 *
 * @author zdy
 * @date 2021/11/8
 */
public class PacketDecoder extends MessageToMessageDecoder {

    @Override
    protected void decode(ChannelHandlerContext channelHandlerContext, Object o, List list) throws Exception {
        list.add(CoderUtils.decode((ByteBuf) o));
    }
}
